package com.example.demo.dynamicProxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Objects;

/**
 * Created by alva on 18/6/26.
 */
public class DynamicProxyHandler implements InvocationHandler {
    private Object target;
    public DynamicProxyHandler(Object target){
        this.target = target;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object object = method.invoke(proxy,args);
        if(object != null){
            System.out.println("object is not null"+object.getClass());
        }else{
            System.out.println("object is null");
        }
        return object;
    }
}
